<template>
  <el-dialog v-model="visible" title="" :width="width_" :before-close="handleClose">
    <img :src="imageUrl" alt="图片" style="width: 100%; height: auto;" />
  </el-dialog>
</template>

<script setup>

const visible = ref(false);
const imageUrl = ref('');

const width_ = ref('30%')

const open = (url,width) => {
  width_.value = width
  imageUrl.value = url;
  visible.value = true;
};

const handleClose = () => {
  visible.value = false;
};

// 暴露 open 方法
defineExpose({ open });

</script>

<style scoped lang="less"></style>
